package com.zmj.job;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

import java.text.SimpleDateFormat;
import java.util.Date;

public class MYQuartzJob implements Job {
    public void  execute (JobExecutionContext jobExecutionContext) throws JobExecutionException{
        //System.out.println("hi,spring整合quartz的第一种方法~！~"+new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").format(new Date()));
        try{
            Runtime runtime = Runtime.getRuntime();

            String  filename = System.currentTimeMillis()+".sql";

            runtime.exec("mysqldump -uroot -padmin mydb -r /Users/zmjha/Desktop/code4/part3/QuartzDemo02_Spring/src/main/resources/"+filename);

        }catch(Exception e){

        }finally{

        }

    }
}
